<template>
    <div>
        <div class="frame">
            <div class="center">
                <div class="circle">
                    <div class="sky"></div>
                    <div class="sun">
                        <div class="sun-light sl1"></div>
                        <div class="sun-light sl2"></div>
                        <div class="sun-light sl3"></div>
                        <div class="sun-light sl4"></div>
                        <div class="sun-light sl5"></div>
                        <div class="sun-light sl6"></div>
                        <div class="sun-light sl7"></div>
                        <div class="sun-light sl8"></div>
                    </div>
                    <div class="ground"></div>
                    <div class="side-left"></div>
                    <div class="side-right"></div>
                    <div class="shadow"></div>
                </div>
            </div>
        </div>
        <btn-group :data="data"></btn-group>
    </div>
</template>

<script>
import btnGroup from "../../..//src/components/FooterButton/index.vue";

export default {
    name: "cssChallengeDay3",
    components: {btnGroup},
    data() {
        return {
            data: null
        };
    },
    created() {
        this.data = this.$route.params
    },
}
</script>

<style lang="scss" scoped>
$cubic-bezier: cubic-bezier(.4, 0, .49, 1); //cubic-bezier是控制变化的速度曲线


.frame {
  position: absolute;
  width: 400px;
  height: 400px;
  left: 50%;
  top: 50%;
  margin-top: -200px;
  margin-left: -200px;
  border-radius: 2px;
  box-shadow: 1px 2px 10px 0 rgba(0, 0, 0, 0.3);
  background: #272C34;
  color: #fff;
}

.center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.circle {
  position: relative;
  overflow: hidden;
  clip-path: circle(90px at 90px 90px);
  width: 180px;
  height: 180px;
  border-radius: 50%;

  .sky {
    position: absolute;
    z-index: 0;
    left: 0; //撑开宽度
    right: 0; //撑开宽度
    height: 124px;
    background: #7DDFFC;
    animation: sky-blue-black 30s infinite $cubic-bezier;
  }

  .sun {
    position: absolute;
    z-index: 2;
    top: 7px;
    left: 73px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #FFEF00;
    //transform-origin: 50% 400%;
    transform-origin: 50% 400%;
    animation: sun-goes-down 30s $cubic-bezier infinite;

    .sun-light {
      width: 8px;
      height: 4px;
      background: #F57209;
      position: relative;
      animation: change-color-sun 30s $cubic-bezier infinite;
    }

    .sl1 {
      left: 14px;
      top: -4px;
      transform: rotate(90deg);
    }

    .sl2 {
      top: -1px;
      left: 29px;
      transform: rotate(-45deg);
    }

    .sl3 {
      top: 8px;
      left: 33px;
    }

    .sl4 {
      top: 17px;
      left: 28px;
      transform: rotate(45deg);
    }

    .sl5 {
      top: 19px;
      left: 14px;
      transform: rotate(90deg);
    }

    .sl6 {
      top: 11px;
      left: 0;
      transform: rotate(-45deg);
    }

    .sl7 {
      top: -8px;
      left: -7px;
    }

    .sl8 {
      top: -26px;
      left: -3px;
      transform: rotate(45deg);
    }
  }

  .ground {
    position: absolute;
    z-index: 1;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #F0DE75;
    animation: fading-sand 30s $cubic-bezier infinite;
  }

  .side-left {
    position: absolute;
    top: 67px;
    left: 35px;
    height: 57px;
    width: 116px;
    background: #F4F4F4;
    clip-path: polygon(0% 100%, 70% 100%, 50% 0%);
    animation: pyramide-shading 30s $cubic-bezier infinite;
  }

  .side-right {
    position: absolute;
    top: 67px;
    left: 35px;
    height: 57px;
    width: 116px;
    background: #DDDADA;
    clip-path: polygon(70% 100%, 100% 100%, 50% 0%);
    animation: pyramide-shading1 30s $cubic-bezier infinite;
  }

  .shadow {
    position: absolute;
    z-index: 2;
    top: 124px;
    left: -80px;
    height: 30px;
    width: 360px;
    background: rgba(0, 0, 0, 0.2);
    transform-origin: 50% 0%;
    clip-path: polygon(115px 0%, 231px 0%, 80% 100%);
    animation: shadow-on-the-floor 30s $cubic-bezier infinite;
  }

}


@keyframes sky-blue-black {
  0% {
    background: #272C34;
  }
  12.5% {
    background: #7DDFFC;
  }
  25% {
    background: #7DDFFC;
  }
  37.5% {
    background: #7DDFFC;
  }
  50% {
    background: #272C34;
  }

  70% {
    background: #272C34;
  }

  100% {
    background: #272C34;
  }
}

@keyframes fading-sand {
  0% {
    background: #272C34;
  }
  12.5% {
    background: #F0DE75;
  }
  25% {
    background: #F0DE75;
  }
  37.5% {
    background: #F0DE75;
  }
  50% {
    background: #272C34;
  }

  70% {
    background: #272C34;
  }

  100% {
    background: #272C34;
  }
}

@keyframes sun-goes-down {
  0% {
    background: #F57209;
    transform: rotate(-90deg);
  }
  12.5% {
    background: #F57209;
    transform: rotate(-45deg);
  }
  25% {
    background: #FFEF00;
    transform: rotate(0deg);
  }
  37.5% {
    background: #FFEF00;
    transform: rotate(45deg);
  }
  50% {
    background: #F57209;
    transform: rotate(90deg);
  }

  70% {
    background: #FFEF00;
  }

  100% {
    background: #F57209;
    transform: rotate(270deg);
  }
}

@keyframes pyramide-shading {
  0% {
    background: #272C34;
  }

  12.5% {
    background: #F4F4F4;
  }

  25% {
    background: #F4F4F4;
  }

  37.5% {
    background: #DDDADA;
  }

  50% {
    background: #272C34;
  }

  70% {
    background: #272C34;
  }

  100% {
    background: #272C34;
  }
}

@keyframes pyramide-shading1 {
  0% {
    background: #272C34;
  }

  12.5% {
    background: #DDDADA;
  }

  25% {
    background: #F4F4F4;
  }

  37.5% {
    background: #F4F4F4;
  }

  50% {
    background: #272C34;
  }

  70% {
    background: #272C34;
  }

  100% {
    background: #272C34;
  }
}

@keyframes shadow-on-the-floor {
  0% {
    transform: scaleY(0);
    clip-path: polygon(115px 0%, 231px 0%, 100% 100%);
  }

  12.5% {
    transform: scaleY(1);
    clip-path: polygon(115px 0%, 231px 0%, 80% 100%);
  }
  25% {
    transform: scaleY(.4);
    clip-path: polygon(115px 0%, 231px 0%, 50% 50%);
  }
  37.5% {
    transform: scaleY(1);
  }

  50% {
    transform: scaleY(0);
    clip-path: polygon(115px 0%, 231px 0%, 0% 100%);
  }
  100% {
    transform: scaleY(0);
    clip-path: polygon(115px 0%, 231px 0%, 0% 100%);
  }
}

@keyframes change-color-sun {
  0% {
    background: #F57209;
  }
  12.5% {
    background: #F57209;
  }
  25% {
    background: #FFEF00;
  }
  37.5% {
    background: #FFEF00;
  }
  50% {
    background: #F57209;
  }

  70% {
    background: #FFEF00;
  }

  100% {
    background: #F57209;
  }
}
</style>